asm
  ld sp,$BFFF
  end asm

#include "./library/smsrnd.bas"
#include "./library/smsdelay.bas"
#include "./library/charmaptgtpanic01test.bas"

dim eee as uinteger at $B010
dim seed as uinteger at $B012
dim ee1 as uinteger at $B014
dim ee2 as uinteger at $B016
dim ee3 as uinteger at $B018
dim ee4 as uinteger at $B01A
dim ee5 as uinteger at $B01C
dim ee6 as uinteger at $B01E


sub tgtpanicputchar(txp1 as uinteger,typ1 as uinteger,tch1 as uinteger,tbm1 as uinteger, txr1 as ubyte)
  dim tylp as uinteger at $B000
  for tylp=0 to 7
    poke $8000+(typ1*8)+tylp+(txp1*256)+0  ,  (  (peek(tbm1+( tch1 *16)+(tylp*2)+1 )) bxor txr1 )   band %01010101
    poke $8000+(typ1*8)+tylp+(txp1*256)+128,  (  (peek(tbm1+( tch1 *16)+(tylp*2)+0 )) bxor txr1 )   band %01010101
    next
  end sub

seed=0

for ee1=0 to 11
  for ee3=0 to 23
    seed=smsrnd(seed)
    tgtpanicputchar(ee3,ee1,64+(seed mod 9),@charmap01,0)
    smsdelay(1000)
    next:next

for ee1=0 to 3
  for ee3=0 to 15
    seed=smsrnd(seed)
    tgtpanicputchar(ee3+7,ee1+3,(ee1*16)+ee3,@charmap01,0)
    tgtpanicputchar(ee3+7,ee1+7,(ee1*16)+ee3,@charmap01,$FF)
    smsdelay(1000)
    next:next





eee=0
do

  tgtpanicputchar(1,1,16+(int(eee/100) mod 10),@charmap01,0)
  tgtpanicputchar(2,1,16+(int(eee/10) mod 10),@charmap01,0)
  tgtpanicputchar(3,1,16+(eee mod 10),@charmap01,0)

  ee1=in(0) bxor 255
  tgtpanicputchar(1,3,16+(int(ee1/100) mod 10),@charmap01,0)
  tgtpanicputchar(2,3,16+(int(ee1/10) mod 10),@charmap01,0)
  tgtpanicputchar(3,3,16+(ee1 mod 10),@charmap01,0)

  ee1=in(1) bxor 255
  tgtpanicputchar(1,4,16+(int(ee1/100) mod 10),@charmap01,0)
  tgtpanicputchar(2,4,16+(int(ee1/10) mod 10),@charmap01,0)
  tgtpanicputchar(3,4,16+(ee1 mod 10),@charmap01,0)


  eee=eee+1
  loop


do:loop

'-----------------------------------------------------


do



for ee1=0 to 11
  for ee3=0 to 23
    seed=smsrnd(seed)
    for ee2=0 to 7
      for ee4=0 to 1
        poke $8000+(ee1*8)+ee2+(ee3*256)+(ee4*128),(peek(@charmap01+( ( seed mod 73)   *16)+(ee2*2)+(1-ee4) ))band %01010101

        next:next
    smsdelay(1000)
    next:next





for ee1=0 to 95 step 8
  for ee3=0 to 6143 step 256
    for ee2=0 to 7
      for ee4=0 to 255 step 128
        seed=smsrnd(seed)
        poke $8000+ee1+ee2+ee3+ee4,seed band %01010101
        out 0,seed
        next:next
    smsdelay(1000)
    next:next


loop

do

loop

do:loop

qqq:

